import React from 'react';
import { Image, View } from '@tarojs/components';
import DBConfig from '@CONFIG/DBConfig'
import './index.scss'

const ImageView = ({ images, dateBucket }) => {
  if (!Array.isArray(images)) return null
  return (
    <View className="image-view-container">
      {images.slice(0, 3).map(item => (
        <Image
          className="image-view-image"
          key={item}
          mode="aspectFill"
          src={`${DBConfig.staticConsultation}${dateBucket ? `${dateBucket}/` : ''}${item}?x-oss-process=image/resize,w_200`}
        />
      ))}
    </View>
  )
}

export default ImageView
